package com.hopes.bizz.risk.transfer.converter.expression;

import com.hopes.bizz.common.core.util.StringUtils;
import com.hopes.bizz.risk.common.constant.HidDicConstant;
import org.mapstruct.Named;

/**
 * @author lyb
 * @version 1.0
 * @date 2024/2/18 14:10
 */
public class RiskHidExp {

    @Named("hidSource")
    public static Integer hidSource(String dangerSrc) {
        if (StringUtils.isEmpty(dangerSrc)) {
            return 10;
        }
        int hidSource = Integer.parseInt(dangerSrc);
        return Math.min(hidSource, 10);
    }

    @Named("hidType")
    public static Integer hidType(String hazardDangerType) {
        if (StringUtils.isEmpty(hazardDangerType)) {
            return 8;
        }
        int hidType = Integer.parseInt(hazardDangerType);
        return Math.min(hidType, 8);
    }
}
